<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRetrievalReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('retrieval_reports', function (Blueprint $table) {
            $table->id();
            $table->integer('patent_apply_id')->comment('专利申请登记ID');
            $table->integer('agency_id')->comment('代理机构ID');
            $table->string('file')->nullable()->comment('检索报告');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->dateTime('review_time')->nullable()->comment('操作时间');
            $table->text('remark')->nullable()->comment('备注');
            $table->timestamps();
        });
        Schema::table('patent_applies',function(Blueprint $table){
            $table->dateTime('file_time')->nullable()->comment('交底上传时间');
        });
        Schema::table('patent_assesses',function(Blueprint $table){
            $table->dateTime('review_time')->nullable()->comment('评估时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('retrieval_reports');
    }
}
